package com.open.party.cloud.view.msg

import android.os.Bundle
import cn.android.x.parent.AppTitleBaseActivity
import com.open.party.cloud.R
import com.open.party.cloud.model.MsgEntity
import com.sinothk.android.utils.XUtils
import kotlinx.android.synthetic.main.msg_activity_details.*

class MsgDetailActivity : AppTitleBaseActivity() {

    private var notice: MsgEntity? = null

    override fun getLayoutResId(): Int = R.layout.msg_activity_details

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setViewTitle("详情")
        notice = intent.getSerializableExtra("notice") as MsgEntity

        initView(notice!!)
    }

    private fun initView(notice: MsgEntity) {
        titleTv.text = XUtils.string().getNotNullValue(notice.noticeContent)
        contentTv.text = XUtils.string().getNotNullValue(notice.description)
        dateTv.text = XUtils.date().getDateStrByDate(notice.noticeTime, "yyyy年MM月dd日")
    }
}